/**
 * Created by Administrator on 2016/1/5.
 */
function AjaxJsonp(url,arg) {
    this.finalUrl = '/coupon' + url;
    this.arg = arg;
    /* 手机验证码回调 */
    _sendSuc = function(sta) {
        $('.modal-body').text(sta.msg);
        $('#myModal').modal();
        isSend = true;
    }
    /*  jsonp  定义*/
    this.doAjaxJsonp = function(callBack) {
        $.ajax({
            url:  this.finalUrl,
            type : "get",
            dataType:'jsonp',
            data:  this.arg,
            jsonp:'callback',
            success:function(res) {
                status = res.status;
                code = status.code;
                if(this.code == 1) {
                    callBack(status);
                }
                if(this.code == 0) {
                    $('.modal-body').text(status.msg);
                    console.log(status.msg);
                    $('#myModal').modal();
                }
            }
        });
    }

}



function ajaxJsonp(url,arg,sendSuc) {
    var finalUrl = '/coupon';
    finalUrl = finalUrl + url;
    $.ajax({
        url: finalUrl,
        type : "get",
        dataType:'jsonp',
        data: arg,
        jsonp:'callback',
        success:function(result) {
            sendSuc(result);
        }
    });
}